<template>
	<view class="">
		<view class="Topbg">


		</view>

		<view class="move">
			<view class="mode">
				<view style="margin:0 auto 40rpx auto;width: 140rpx;">

					<u-image src="/static/accounttitle.png" width="140" height="60"></u-image>
				</view>
				<view class="u-flex u-row-between u-margin-top-80">
					<view class="u-flex">
						<u-image :src="imagesurl+'/images/my_4.png'" width="60" height="60"></u-image>
						<text class="moneny u-margin-left-20">{{moneny}}</text>
					</view>
					<view class="u-flex">
						<view class="btn red" @click="use">使用</view>
						<view class="btn blue" @click="tixian">提现</view>
			    	</view>
				</view>
			</view>
			
			<view class="mode">
				
				<view style="margin:0 auto 40rpx auto;width: 140rpx;">
				
					<u-image src="/static/yuertitle.png" width="140" height="60"></u-image>
				</view>
				
				
				<view v-for="(item,index) in list" :key="index" class="List u-flex u-border-bottom u-padding-20">
					<view :class="Number(item.number)<0?'tred':'tblue'">￥{{item.number}}</view>
					
					<view>
					 <view>{{item.remark}}</view>  
					 <view style="color: #999;font-size: 20rpx;margin-top: 10rpx;">{{item.createTime}}</view>  
					</view>
				</view>
				
				<u-loadmore :status="status" />
				
				
			</view>
			
		</view>
		
		
		
		
		

	</view>
</template>

<script>

	import url from '@/common/baseUrl.js';

	export default {

		data() {
			return {
				imagesurl: url.imageUrl,
				moneny: "",
				status: 'loadmore',
				page: 1,
				
				list:[]
			}
		},
		methods: {
           tixian(){
			   uni.navigateTo({
			   	url:"./tixian"
			   })
		   },
		   get(){
			   this.$u.post('/api/user/information', {
			   
			   }, {}).then(res => {
			      this.moneny=res.data.commission
			 
			   }).catch(err => {})
		   },
		   jiazai(){
		   			   this.$u.post('/api/Financial/commission', {
		   			   
		   			   }, {}).then(res => {
		   			    var resList = res.data;
		   			    if (this.page == 1) {
		   			    	this.list = []
		   			    }
		   			    if (resList.length > 9) {
		   			    	this.status = 'loadmore'
		   			    	this.page = this.page + 1
		   			    } else {
		   			    	this.status = 'nomore'
		   			    }
		   			    this.list = this.list.concat(resList)
		   			    this.loading = false
		   			 
		   			   }).catch(err => {})
		   },
		   use(){
			   uni.switchTab({
			   	  url:"/pages/shop/index"
			   })
		   }
		 
		   
		},
		onShow() {
			this.get()
			this.jiazai()
			
		},
		onReachBottom() {
			if (this.status == 'nomore') {
		
			} else {
				this.jiazai()
			}
		
		},
	}
</script>

<style lang="scss">
	@import 'common.css';
</style>
